nextRound
TechnologiesCoding ProblemsBookmarksLearning Paths
nextRound
TechnologiesCoding ProblemsBookmarksLearning Paths
nextRound

AI-powered interview preparation platform. Practice with curated questions, mock interviews, and personalized learning paths to crack your dream tech interview.

Quick Links

  • Technologies
  • Saved Questions
  • Pricing

Company

  • About Us
  • Contact Us

Legal

  • Privacy Policy
  • Terms of Use

© 2026 nextRound. All rights reserved.

TOPIC OVERVIEW

javascript/String Operations

Why strings look simple until Unicode, immutability, and performance get involved.

10 QuestionsIntermediateMedium Priority ~11 min read

Strings in JavaScript are immutable — every method that seems to 'modify' a string (slice, replace, toUpperCase) actually returns a new string, leaving the original untouched. That immutability is also why repeated concatenation in a loop can get expensive: each += potentially creates a new string in memory rather than appending in place, which is part of why patterns like array.join() exist as a faster alternative for building large strings.

Strings are also more subtle than they look once you leave ASCII. JavaScript strings are UTF-16 internally, so length and index-based access count UTF-16 code units, not visible characters — which is why some emoji and rare characters (anything outside the Basic Multilingual Plane) report a length of 2 and can break naive character-by-character logic. That's also the difference between charCodeAt (a single UTF-16 unit) and codePointAt (the full Unicode code point, correctly handling surrogate pairs).

What you'll walk away knowing

Why strings are immutable and what that means for methods like slice, replace, and concat
Why repeated += concatenation is slower than array.join(), and when that actually matters
How UTF-16 encoding affects .length and indexing for characters outside the Basic Multilingual Plane
The practical difference between charCodeAt/codePointAt and when each gives the wrong answer

No questions match "".

All Topics
1
Basics
Data Types
Functions
Objects
2
Engine
JIT
V8
Event Loop and Runtime
Concurrency and Threading
Bytecode and Parsing
Execution Context
Garbage Collector
3
this
Call Apply Bind
Closure
Error Handling
4
String Operations
Array Operations
Iterator and Generator
Modules
5
Events
Promises
Web Workers
Web Sockets
6
Functional Programming
Currying
Higher Order Functions
Memoisation
7
ES6 Classes
ES6
PWA
Web Assembly
Browser APIS
8
Security
Code
Polyfills
Sharethis topic

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.